(function () {
    function findMinAndMaxNumber(array) {
        array.sort(function(a, b){return a-b});
        
        console.log('Min: ' + array[0]);
        console.log('Max: ' + array[array.length - 1]);
    }

    findMinAndMaxNumber([1, 2, 1, 15, 20, 5, 7, 31]);
    findMinAndMaxNumber([2, 2, 2, 2, 2]);
}());